<template>
	<div>
		<div class="myC">我的收藏</div>
		<div class="libiao">
			<ul>
				<li>
					<div class="fl">{{ lis }}</div>
					<div class="fr">
						<img :src="tu" alt="">
					</div>
					<div class="clear"></div>
				</li>
			</ul>
		</div>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				receive:'',
				arr:[],
				lis:'',
				tu:''
			}
		},
		mounted() {
			this.getmycollection()
			this.getnweinformation()
		},
		methods:{
			getmycollection:function(){
				this.receive = JSON.parse(localStorage.getItem('userinfo'));
				this.$http.post('http://chonghekj.com/daily/index.php/Home/user/collection',this.$qs.stringify({
					id:this.receive.id,
					access_token:this.receive.access_token
				}))
				.then((res)=>{
					this.arr = res.data.data
					console.log(this.arr)
				})
			},
			getnweinformation:function(){
				for(let i=0;i<this.arr.length; i++){
					this.$http.get('http://chonghekj.com/daily/index.php/Home/daily/detail',{
						params:{
							id:this.arr[i]
						}
					})
					.then((res)=>{
						console.log(res)
						this.lis = res.data.title
						this.tu = res.data.image
					})
				}
			}
		},
		watch:{
			arr:function(){
				this.getnweinformation()
			}
		}
	}
</script>

<style lang="less">
	.myC{
		width: 100%;
		height: 50px;
		background: #f4f4f5;
		text-align: center;
		line-height: 50px;
		font-size: 18px;
	}
	.libiao{
		ul li{
			div img{
				width: 70px;
				height: 70px;
			}
		}
	}
</style>
